﻿greater_rivals_interaction = {
    interface_priority = 80
    common_interaction = no 
    icon = icon_hostile
    category = interaction_category_hostile
    desc = {
        first_valid = {
            triggered_desc = {
                trigger = { scope:actor = { age < 18} }
                desc = young_rival_desc
            }
            triggered_desc = {
                trigger = { scope:actor = { age >= 18 } }
                desc = adult_rival_desc
            }
            desc = fallback_rival_desc
        }
    }

    notification_text = greater_rival_notification_text 
    greeting = negative
    cooldown_against_recipient = { years = 4 }  

    is_shown = {
        scope:actor = { 
            OR = {
                AND = { 
                    age > 7 
                    age < 18
                    scope:recipient = { 
                        age > 7
                        age < 18 
                    }
                }

                AND = {
                    age > 18 
                    scope:recipient = {
                        age > 18
                    }
                }
            }
        }

        scope:recipient = {
            OR = {
                has_relation_rival = scope:actor
                has_relation_nemesis = scope:actor
            }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { age > 17 }
        scope:recipient = {
            age > 17
            top_liege = scope:actor
        }
      
    }

    override_background = { reference = relaxing_room }

    #popup_on_recieve = yes
    #pause_on_recieve = yes
    show_effects_in_notification = yes

    on_send = {
        scope:recipient = {
            add_character_flag = rival_interaction_flag
        }


        scope:actor = {
            add_prestige = 25
            rivals_interaction_events_scripted_effect_group = yes

        }
    }

    on_accept = {
        scope:actor = {
            add_prestige = 5
        }
        scope:recipient = {
            add_prestige = 5
        }
    }

    ai_potential = {
        scope:actor = { 
            OR = {
                AND = { 
                    age > 7 
                    age < 18
                    scope:recipient = { 
                        age > 7
                        age < 18 
                    }
                }

                AND = {
                    age > 18 
                    scope:recipient = {
                        age > 18
                    }
                }
            }
        }

        scope:recipient = {
            OR = {
                has_relation_rival = scope:actor
                has_relation_nemesis = scope:actor
            }
        }
    }

    ai_will_do = { 
        base = 10 

        modifier = { 
            add = 20 
            scope:actor = {
                OR = { 
                  has_trait = brave 
                  has_trait = calm    
                  has_trait = temperate 
                  has_trait = paranoid 
                  has_trait = sadistic
                  has_trait = vengeful 
                  has_trait = deceitful
                  has_trait = ambitious
                }  
            }
        }

        modifier = { 
            add = 50 
            scope:recipient = { OR = { has_trait = trusting } } 
        }

        modifier = { 
            add = -50 
            scope:actor = { 
                OR = { 
                    has_trait = craven 
                    has_trait = lazy  
                    has_trait = loyal  
                    has_trait = shy
                    has_trait = compassionate 
                    has_trait = just

                }
            }
        }
    }


    auto_accept = yes
}

greater_friends_interaction = {
    interface_priority = 80
    common_interaction = no
    icon = icon_scheme_befriend
    category = interaction_category_friendly  
    desc = {
        first_valid = {
            triggered_desc = {
                trigger = { scope:actor = { age < 18 } }
                desc = young_friend_desc
            }
            triggered_desc = {
                trigger = { scope:actor = { age >= 18 } }
                desc = adult_friend_desc
            }
            desc = fallback_friend_desc
        }
    }


    notification_text = greater_friendly_notification_text
    greeting = positive
    cooldown_against_recipient = { years = 4}

    is_shown = {
        scope:actor = {
            OR = {
                AND = {
                    age > 7 
                    age < 18
                    scope:recipient = {
                        age > 7
                        age < 18
                    }
                }

                AND = {
                    age > 18
                    scope:recipient = {
                        age > 18
                    }
                }
            }
        }

        scope:recipient = {
            OR = {
                has_relation_friend = scope:actor
                has_relation_best_friend = scope:actor
            }
        }
    }

    is_valid_showing_failures_only = {
        #scope:actor = { 
        #    OR = {
        #        AND = {   #I Am A Kid, You Are An Adult
        #            age > 7 
        #            age < 18
        #            scope:recipient = { 
        #                age > 7
        #                age > 18 
        #            }
        #        }
    
        #        AND = { #I Am An Adult, You Are A Kid
        #            age > 18 
        #            scope:recipient = {
        #                age < 18
        #            }
        #        }
        #    }
        #}

        scope:actor = { age > 17 }
        scope:recipient = {
            age > 17
            top_liege = scope:actor
        }
    }

    override_background = { reference = relaxing_room }

    #popup_on_recieve = yes
    #pause_on_recieve = yes
    show_effects_in_notification = no

    on_send = {
        scope:recipient = {
            add_character_flag = friend_interaction_flag
        }
        
        scope:actor = {
            add_prestige = 50
            friends_interaction_events_scripted_effect_group = yes
        }
        
    }


    on_accept = {
        scope:actor = {
            add_prestige = 5
        }
        scope:recipient = {
            add_prestige = 5
        }
    }

    ai_potential = {
        scope:actor = { 
            OR = {
                AND = { 
                    age > 7 
                    age < 18
                    scope:recipient = { 
                        age > 7
                        age < 18 
                    }
                }

                AND = {
                    age > 18 
                    scope:recipient = {
                        age > 18
                    }
                }
            }
        }

        scope:recipient = {
            OR = {
                has_relation_friend = scope:actor
                has_relation_best_friend = scope:actor
            }
        }
    }

    ai_will_do = { 
        base = 10 

        modifier = { 
            add = 20 
            scope:actor = {
                OR = { 
                  has_trait = brave 
                  has_trait = compassionate    
                  has_trait = ambitious 
                  has_trait = eccentric
                  has_trait = gregarious
                  has_trait = loyal
                  has_trait = temperate
                  has_trait = lustful
                  has_trait = generous
                  has_trait = gluttonous
                }  
            }
        }

        modifier = { 
            add = 50 
            scope:recipient = { OR = { has_trait = trusting } } 
        }

        modifier = { 
            add = -50 
            scope:actor = { 
                OR = { 
                    has_trait = craven 
                    has_trait = lazy    
                    has_trait = shy
                    has_trait = cynical
                    has_trait = reclusive
                    has_trait = irritable
                }
            }
        }
    }


    auto_accept = yes
}